<template>
	<view class="container">
		<headerTop title="个人设置"></headerTop>

		<view class="con_auto">
			<u--form labelPosition="top" :model="dataForm" ref="uForm" labelWidth="150">
				<u-form-item label="注册会员手机号一致" prop="mobile" borderBottom ref="item1">
					<u--input v-model="dataForm.mobile" border="none" placeholder="请输入手机号"></u--input>
				</u-form-item>
			</u--form>
			<view class="btn">
				<u-button @click="submit" type="primary">提交</u-button>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			dataForm: {
				mobile: ''
			}
		};
	},
	methods: {
		submit() {
			let _this = this;
			let ExternalUserID = uni.getStorageSync('ExternalUserID');
			let welcome_code = uni.getStorageSync('welcome_code');
			_this
				.$http('user/bindUserMobile', {
					..._this.dataForm,
					ExternalUserID,
					welcome_code
				})
				.then((res) => {
					if (res.code) {
						_this.$u.toast('绑定成功');
						_this.$goBack();
					}
				});
		}
	}
};
</script>

<style lang="scss" scoped>
.btn {
	margin-top: 24rpx;
}
</style>
